chore(lint): fix pre-existing golangci-lint issues#87
Conversation
Clean up the trivial (non-deprecation) issues reported by golangci-lint that don't block CI but were flagged by the new quality gate: - unparam: drop the unused *Goal return from (*GoalStore).setStatus; both callers only used the bool. - goimports: regroup the third-party import in goal_test.go. - ineffassign: replace `remotePwd := "/root"` with `var remotePwd string` in ssh.go since the initializer was always overwritten. - gocritic (deprecatedComment): move the AutoApprove `Deprecated:` notice into its own paragraph. - gocritic (ifElseChain): rewrite the team_send_message if-else chain in acp.go as a switch. Fixing the Deprecated: comment format made staticcheck correctly recognize AutoApprove as deprecated, surfacing two SA1019 warnings on intentional fallback reads. Those reads are documented behavior (the field is still honored when DefaultMode is unset), so they are annotated with //nolint:staticcheck rather than removed. The 9 remaining adk.AgentMiddleware SA1019 warnings are intentionally left for the separate dependency-migration task. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughA collection of small independent cleanups: ChangesMiscellaneous Cleanups
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
golangci-lint run ./...that don't block CI (only-new-issues: true) but were flagged by the new quality gate.Related Issues / Tickets
.github/workflows/ci.yml.Type of Change
Changes Made
*Goalreturn from(*GoalStore).setStatus; both callers (Complete/Block) only used thebool.internal/sessionimport into its own third-party group.remotePwd := "/root"withvar remotePwd string; the initializer was always overwritten by the following if/else.AutoApproveDeprecated:notice into its own paragraph.team_send_messageif-else chain as a taglessswitch.Testing
golangci-lint run ./...→ only the 9adk.AgentMiddlewareSA1019 deprecation warnings remain (intentionally left for the separate dependency-migration task); 0 other issues.go build ./...→ OKgo test ./...→ all packages passAdditional Notes
Fixing the
Deprecated:comment format (#4) made staticcheck correctly recognizeAutoApproveas deprecated, surfacing two new SA1019 warnings on intentional fallback reads (interactive.go, tui.go). Those reads are documented behavior — the field is still honored as a fallback whenDefaultModeis unset — so they're annotated with//nolint:staticcheckrather than removed. This keeps the remaining-warning count at exactly the 9adk.AgentMiddlewareitems.🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
Tests
Chores